#pragma once

#include <QObject>
#include <QVariant>
#include <QThread>
#include <QVector>

#include "XmlRpcServer.h"
#include "XmlRpcService.h"

#include "RsGisLibWork.h"

class RsGisRpcService : public XmlRpcService
{
	Q_OBJECT
	
public:
	RsGisRpcService(QObject* parent = 0);
	void initService() override;

private slots:
	QString callState(int i);
	QVariant birne(int x);
	QDateTime plusOneYear(QDateTime sometime);

	QVariantList tableQuery(QVariantList args);
	QVariantList userLogin(QString userID, QString pwd);
	QString userInsert(QVariantList args);
	QString userUpdate(QVariantList args);
	QString userDelete(QVariantList args);

	QVariantList CallforServiceList(int iIndex);

	QVariantList RsGisLibExecuteFilter(QVariantList ArgList);
	QVariantList RsGisLibImageCalculation(QVariantList ArgList);
	QVariantList RsGisLibElevation(QVariantList ArgList);
	QVariantList RsGisLibMorphology(QVariantList ArgList);
	QVariantList RsGisLibImageCalibration(QVariantList ArgList);
	QVariantList RsGisLibClassification(QVariantList ArgList);
	QVariantList RsGisLibSegmentation(QVariantList ArgList);
	QVariantList RsGisLibRegistration(QVariantList ArgList);
	QVariantList RsGisLibImageUtils(QVariantList ArgList);
	QVariantList RsGisLibZonalStats(QVariantList ArgList);
	QVariantList RsGisLibRasterGIS(QVariantList ArgList);

signals:
	void outMessage(QString data);

protected:
	QString decrypt(QString input);
	QString encrypt(QString input);

protected:
	//XmlRpcServer *rpcServer;
};


